<%= render 'node_selector', node: @topic.node %>
<%= simple_form_for @topic, html: { class: "form" } do |f| %>
  <%= render "shared/error_messages", target: @topic %>
  <%= f.hidden_field :node_id %>
    <div class="form-group">
      <div class="input-group">
        <div class="input-group-btn">
          <button type="button" class="btn btn-default" id="node-selector-button"
                  data-toggle="modal" data-target="#node-selector"><%= @topic.node&.name || '选择节点...' %></button>
        </div>
        <%= f.text_field :title, class: "form-control", placeholder: "在这里填写标题" %>
      </div>
    </div>

  <%= render "editor_toolbar" %>

  <div class="form-group">
    <%= f.text_area :body, placeholder: "1. 描述清楚你的主题

2. 贴上相关代码，请使用代码块

3. 贴上相关信息

4. 贴上相关截图（代码，请不要用截图）

5. 已经尝试过哪些方法仍然没解决（附上相关链接）

6. 我们是原创社区,鼓励原创,如果转发请得到原作者同意并注明出处

" , id: "topic-editor-textarea", class: "topic-editor form-control closewarning", rows: 20, identify: "topic-editor-form" %>
  </div>

  <% if @topic.new_record? %>
    <%= render partial: "polls/form" %>
  <% end %>

    <span class="help-inline">
                    <label>
                      <%= f.check_box :cannot_be_shared %>  <%= t("topics.cannot_be_shared")%>
                    </label>
                  </span>


    <div class="form-group">
    <%= f.submit t("common.save"), class: "btn btn-primary col-xs-2", 'data-disable-with' => t("common.saving") %>
    <div class="pull-right"><a href="/markdown" target="_blank"><i class="fa fa-tip"></i> 排版说明</a></div>
  </div>
<% end %>
